package com.binance.binancedemo.cell

import android.view.ViewGroup
import com.binance.binancedemo.R
import com.binance.binancedemo.entity.Ticker
import com.binance.binancedemo.recycler.BaseRecyclerCell
import com.binance.binancedemo.recycler.BaseRecyclerViewHolder

/**
 * Created by zhangkaiyu on 17/12/12.
 */
class LabelCell(ticker:Ticker) : BaseRecyclerCell<Ticker, BaseRecyclerViewHolder>(ticker) {

    override fun reloadResource() {
    }

    override fun releaseResource() {
    }

    override fun createViewHolder(parent: ViewGroup?): BaseRecyclerViewHolder {
        return createHolderByLayout(R.layout.c_label, parent)
    }

    override fun onBindViewHolder(viewHolder: BaseRecyclerViewHolder) {
        viewHolder.setText(R.id.tv_label, mData.symbol)
    }

    override fun getType(): Int {
        return 1
    }

    override fun areContentsTheSame(cell: BaseRecyclerCell<*, *>?): Boolean {
        return mData.symbol == (cell?.data as Ticker).symbol
    }
}